//
//  FMListDateilTableViewCell.m
//  XWZ_News_Work
//
//  Created by dllo on 16/1/11.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "FMListDateilTableViewCell.h"

#define PAD (10 * HEIGHT)

@implementation FMListDateilTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubview];
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    [self.imageV mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(self.contentView).with.offset(PAD);
        
        make.left.mas_equalTo(@(5 * HEIGHT));
        make.height.equalTo(self.contentView.mas_height).with.offset(-PAD);
        make.width.equalTo(self.contentView.mas_height).with.offset(PAD);
        
    }];
    
    [self.labelName mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(self.imageV.mas_top).with.offset(PAD);
        make.left.equalTo(self.imageV.mas_right).with.offset(PAD);
        make.right.equalTo(self.contentView.mas_right).with.offset(-PAD);
        make.height.mas_equalTo(@(15 * HEIGHT));
        
    }];
    
    [self.labelTitle mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(self.labelName.mas_bottom).with.offset(PAD);
        make.left.equalTo(self.labelName.mas_left);
        make.width.equalTo(self.labelName.mas_width);
        make.height.mas_equalTo(@(50 * HEIGHT));
        
        
    }];
    
    [self.imageL mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(self.labelTitle.mas_bottom).with.offset(PAD);
        make.left.equalTo(self.labelTitle.mas_left);
        make.height.equalTo(@(20 * HEIGHT));
        make.width.equalTo(@(20 * HEIGHT));
        
    }];
    
    
    
    [self.labelNum mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(self.imageL.mas_top);
        make.left.equalTo(self.imageL.mas_right).with.offset(PAD);
        make.height.equalTo(self.imageL.mas_height);
        make.width.equalTo(@(100 * HEIGHT));
        
    }];
    
    
}



- (void)createSubview
{
    self.backgroundColor = [UIColor whiteColor];
    
    self.imageV = [[UIImageView alloc] init];
//    self.imageV.backgroundColor = [UIColor redColor];
    [self.contentView addSubview:self.imageV];
    self.layer.masksToBounds = YES;
    self.layer.cornerRadius = 5 * WIDTH;
    self.labelName = [[UILabel alloc] init];
//    self.labelName.text = @"网易新闻";
    self.labelName.font = [UIFont systemFontOfSize:15.0 * WIDTH];
    [self.contentView addSubview:self.labelName];
    
    self.labelTitle = [[UILabel alloc] init];
//    self.labelTitle.text = @"网易新闻网易新闻网易新闻网易新闻网易新闻网易新闻";
    self.labelTitle.numberOfLines = 2;
    self.labelTitle.font = [UIFont systemFontOfSize:16.0 * WIDTH];
    [self.contentView addSubview:self.labelTitle];
    
    self.imageL = [[UIImageView alloc] init];
//    self.imageL.backgroundColor = [UIColor blueColor];
    [self.contentView addSubview:self.imageL];
    
    
    
    self.labelNum = [[UILabel alloc] init];
    self.labelNum.text = @"2568970";
    self.labelNum.font = [UIFont systemFontOfSize:15.0 * WIDTH];
    self.labelNum.textColor = [UIColor grayColor];
    [self.contentView addSubview:self.labelNum];
    
    
    
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
